from django.conf.urls import url

from . import views

urlpatterns = [
#     正则组取值
    url(r'^weather1/([a-z]+)/(\d{4})/$',views.weather1),
    # 关键字参数
    url(r'^weather2/(?P<city>[a-z]+)/(?P<year>\d{4})/$',views.weather2),

#    获取查询的字符串
    url(r'^weather3/(?P<city>[a-z]+)/(?P<year>\d{4})/$',views.weather3),
    # 获取请求体中表单的数据
    url(r'^get_body_from/$',views.get_body_from),
#    获取请求体中非表单的数据
    url(r'^get_body_json/$',views.get_body_json),
#     演示通过response设置响应体和状态码
    url(r'^move/$',views.move),
#     演示通过jsonresponse
    url(r'^demo/$',views.demo),
#     演示redirect重定向
    url(r'^view/$',views.view),
#     设置cookie信息
    url(r'^cookie$',views.cookie),
#     设置获取cookie
    url(r'^cookies/$',views.cookies),
#     演示session缓存数据的读取
    url(r'^session_demo/$',views.session_demo),

    url(r'^viewtemplatesss/$',views.viewtemplatesss.as_view()),
]